package controllers;

import models.forms.IndexForm;
import play.data.Form;
import play.mvc.*;
import views.html.*;

public class Application extends Controller {

	final static Form<IndexForm> userForm = Form.form(IndexForm.class);
	
    public static Result index() {
        return ok(index.render("Your new application is ready."));
    }
    
    public static Result indexBadugi(){
    	return ok(indexBadugi.render());
    }
    
    public static Result indexSubmit(String userName){
    	
    	if(userName == null || userName.trim().equals("")) {
            flash("error", "Please choose a valid username.");
            return redirect(routes.Application.indexBadugi());
        }
        return ok(gameRoom.render(userName));
    }

}
